load("@rules_cc//cc:cc_library.bzl", "cc_library")

cc_library(
    name = "fastjson",
    srcs = glob(["src/*.cpp"]),
    hdrs = glob(["include/**/*.h"]),
    copts = select({
        "@platforms//os:windows": [],
        "//conditions:default": [
            "-Wno-unused-variable",  # Ignore unused element - Don't pollute downstream users
        ],
    }),
    includes = ["include"],  # Expose for import without include prefix
    visibility = ["//visibility:public"],
)

# This must be defined in top level BUILD as we can't access files above the target(s) file
cc_library(
    name = "fastjson-test-srcs",
    hdrs = glob(["src/*.cpp"]),
    includes = ["include/fastjson"],  # Tests need access to includes without fastjson folder prefix
    visibility = ["//tests:__pkg__"],
)
